var confirmMsg  = 'Do you really want to ';

/**
 * Displays an confirmation box before to submit a "DROP/DELETE/ALTER" query.
 * This function is called while clicking links
 *
 * @param   object   the link
 * @param   object   the sql query to submit
 *
 * @return  boolean  whether to run the query or not
 */
function confirmLink(theLink, theSqlQuery)
{
    // Confirmation is not required in the configuration file
    // or browser is Opera (crappy js implementation)
    /*if (confirmMsg == '' || typeof(window.opera) != 'undefined') {
        return true;
    }*/

    var is_confirmed = confirm(confirmMsg + ' ' + theSqlQuery +  '\nThis CANNOT be undone');
    if (is_confirmed) {
        if ( typeof(theLink.href) != 'undefined' ) {
            theLink.href += '&is_js_confirmed=1';
        } else if ( typeof(theLink.form) != 'undefined' ) {
            theLink.form.action += '?is_js_confirmed=1';
        }
    }

    return is_confirmed;
} // end of the 'confirmLink()' function


function confirmLink2(){
	return confirm('Do you really want to follow this link?')
}


function toggleDisable(element){
		if( element.disabled == false ){
			element.disabled = true;
		}else{
			element.disabled = false;
		}
	}
	
function validate_required(field,alerttxt)
{
with (field)
{
if (value==null||value=="")
  {alert(alerttxt);return false;}
else {return true}
}
}

function validate_form(thisform)
{
with (thisform)
{
if (validate_required(numberOfImages,"Number Of Images Is Blank!") == false)
  {numberOfImages.focus();return false;}
}
}
